home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / vbcc / machines / amiga68k / libsrc / stdio / fseek.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-21  |  359 b   |  16 lines

  1. #include <stdio.h>
  2.  
  3. int fseek(FILE *f,long offset,int origin)
  4. {
  5.     if(!f) return(1);
  6.     if(origin==SEEK_CUR){
  7.         if(f->flags&_READ) offset-=f->count;
  8. /*        if(f->flags&_WRITE) offset+=f->count;*/
  9.     }
  10.     if(f->flags&_WRITE) _flushbuf(f);
  11.     f->flags&=~(_READ|_WRITE|_EOF);
  12.     f->count=0;
  13.     Seek(f->filehandle,offset,origin);
  14.     return(0);
  15. }
  16.